﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="filmDetail.aspx.vb" Inherits="gojira.filmDetail" %>
<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
        DataSourceID="detailedInfo" GridLines="None" ShowHeader="False" 
        style="float:left; margin-right: 19px;">
        <Columns>
            <asp:TemplateField>
            <ItemTemplate>
                <asp:Image ID="Image1" runat="server" Height="400px" Width="300px" ImageUrl='<%# Eval("poster") %>' />
            </ItemTemplate>
            </asp:TemplateField>
        </Columns>
    </asp:GridView>
        <asp:GridView ID="GridView5" runat="server" AutoGenerateColumns="False" 
        DataSourceID="detailedInfo" GridLines="None" ShowHeader="False" style="float:left">
        <Columns>
            <asp:TemplateField>
            <ItemTemplate>
            <h1><%# Eval("filmName") %></h1>
                <p>Release year: <%# Eval("releaseYear")%></p>
                <p>Director: <%# Eval("director")%></p>
                <p>Running time: <%# Eval("runTime")%> minutes</p>
                <p><asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='<%# Eval("wikiLink") %>' Text="More information" /></p>
            
            </ItemTemplate>
            </asp:TemplateField>
            </Columns>
    </asp:GridView>
    <div style="float:right">
    Home video releases for this film:<br />
    <br />
    <asp:GridView ID="GridView3" runat="server" AutoGenerateColumns="False" 
        DataSourceID="SqlDataSource1" Width="225px">
        <Columns>
            <asp:BoundField DataField="Format" HeaderText="Format" 
                SortExpression="Format" />
            <asp:BoundField DataField="Region" HeaderText="Region" 
                SortExpression="Region" />
            <asp:HyperLinkField DataNavigateUrlFields="ID" 
                DataNavigateUrlFormatString="releaseDetail.aspx?ID={0}" HeaderText="Detail" 
                Text="Detail" />
        </Columns>
    </asp:GridView>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:godzillaFilms %>" 
        ProviderName="<%$ ConnectionStrings:godzillaFilms.ProviderName %>" 
        
        SelectCommand="SELECT [Format], [Region], [ID] FROM [godzillaFilmsQuery] WHERE ([FilmID] = ?)">
        <SelectParameters>
            <asp:QueryStringParameter Name="FilmID" QueryStringField="ID" Type="Int32" />
        </SelectParameters>
    </asp:SqlDataSource>
    <asp:SqlDataSource ID="detailedInfo" runat="server" 
        ConnectionString="<%$ ConnectionStrings:godzillaFilms %>" 
        ProviderName="<%$ ConnectionStrings:godzillaFilms.ProviderName %>" 
        
        SelectCommand="SELECT [filmName], [releaseYear], [director], [poster], [wikiLink], [runTime] FROM [godzillaFilms] WHERE ([ID] = ?)">
        <SelectParameters>
            <asp:QueryStringParameter Name="ID" QueryStringField="ID" Type="Int32" />
        </SelectParameters>
    </asp:SqlDataSource>
    <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
    </asp:ToolkitScriptManager>
        <br />
        Average user&#39;s rating:<br />
        <br />
        <asp:Rating  BorderWidth="1" BorderStyle="None"
        width="200" 
        Height="40" 
        ID="rating_average" 
        runat="server" 
        StarCssClass="ratingStar" 
        WaitingStarCssClass="savedRatingStar" 
        EmptyStarCssClass="emptyRatingStar" 
        filledStarCssClass="filledRatingStar"
        MaxRating="5" ReadOnly="True" 
    >
        </asp:Rating>
        <br />
        
        
    <asp:GridView ID="GridView4" runat="server" AutoGenerateColumns="False" 
        DataKeyNames="ID" DataSourceID="SqlDataSource2" GridLines="None" 
        ShowHeader="False">
        <Columns>
            <asp:TemplateField>
            <ItemTemplate>
            <a href='FilmReview.aspx?ID=<%# Eval("ID") %>'>Rate this film</a>
            <br />
            <br />
            <a href='FilmComment.aspx?ID=<%# Eval("ID") %>'>Comment on this film</a>
            </ItemTemplate>
            </asp:TemplateField>
        </Columns>
    </asp:GridView>
    <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
        ConnectionString="<%$ ConnectionStrings:godzillaFilms %>" 
        ProviderName="<%$ ConnectionStrings:godzillaFilms.ProviderName %>" 
        SelectCommand="SELECT [ID] FROM [godzillaFilms] WHERE ([ID] = ?)">
        <SelectParameters>
            <asp:QueryStringParameter Name="ID" QueryStringField="ID" Type="Int32" />
        </SelectParameters>
    </asp:SqlDataSource>
    <br />
    <asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False" 
        DataSourceID="comment" Width="328px">
        <Columns>
            <asp:TemplateField HeaderText="Comments">
            <ItemTemplate>
            <div>
                <h1>User: <%# Eval("Author")%></h1>
                <h2>Subject: <%# Eval("Subject")%></h2>
                <p><%# Eval("Comment") %></p>
            </div>
            </ItemTemplate>
            </asp:TemplateField>
        </Columns>
    </asp:GridView>
    <br />
    <asp:SqlDataSource ID="comment" runat="server" 
        ConnectionString="<%$ ConnectionStrings:godzillaFilms %>" 
        ProviderName="<%$ ConnectionStrings:godzillaFilms.ProviderName %>" 
        
        SelectCommand="SELECT [Author], [Subject], [Comment] FROM [comments] WHERE ([filmID] = ?)">
        <SelectParameters>
            <asp:QueryStringParameter Name="filmID" QueryStringField="ID" Type="Int32" />
        </SelectParameters>
    </asp:SqlDataSource>
    </div>
    </asp:Content>
